// phonebook.h
#ifndef PHONEBOOK_H
#define PHONEBOOK_H

#define MAX_CONTACTS 100 // 通讯录最大容量
#define NAME_LENGTH 21   // 姓名长度(包含'\0')
#define PHONE_LENGTH 12  // 电话长度(包含'\0')

typedef struct {
	char name[NAME_LENGTH];
	char phone[PHONE_LENGTH];
} Contact;

typedef struct {
	Contact contacts[MAX_CONTACTS];
	int     count;
} PhoneBook;

void initializePhoneBook(PhoneBook *pb);
void addContact(PhoneBook *pb);
void searchContact(const PhoneBook *pb);
void displayContacts(const PhoneBook *pb);

#endif /* PHONEBOOK_H */
